#include "utilitaireString.h"

void copier_Uti(char ** dest, const char * src)
{
  if((*dest) != NULL)
    {
      free((*dest));
      (*dest) = NULL;
    }
  if(src)
    {
      (*dest) = (char *) malloc ((1 + strlen(src)) * sizeof(char));
      if((*dest) == NULL)
	{
	  fprintf(stderr, "Mémoire insuffisante");
	  exit(EXIT_FAILURE);
	}
      strcpy((*dest), src);
    }
}

void detruire_Uti(char ** uti)
{
  if((*uti))
    {
      free((*uti));
      (*uti) = NULL;
    }
}
